// 2013-9-26下午02:29:22  net.betou.common.web.springmvc.WebApplicationUtils.java

package net.betou.common.web.springmvc;

import javax.servlet.ServletContext;

import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ServletContextAware;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * 
 * @author 叶装装
 */
public class WebApplicationUtils implements ServletContextAware{

	public Object getBean( String beanName) {
		return ctx.getBean( beanName );
	}

	public void setServletContext( ServletContext context ) {
		ctx =  WebApplicationContextUtils.getWebApplicationContext( context );
	}

	private ApplicationContext ctx;
	
}
